# Todo

## GNU Emacs Features
### Easy
- [x] delete word
- [x] show selected region
- [x] M-\ remove whitespace
- [x] C-o, insert newline below
- [x] C-l, recenter screen
- [x] C-t and M-t, transposes
- [x] highlight isearch results
  - it only highlights the one you're on
- [x] universal argument (C-u)
  - only works with some functions for now
- [x] numerical arguments (C-[0-9])
- [x] zap to char (M-z)
- [x] suspend (C-z)
- [x] lowercase/upper case word
- [x] display line/col in modeline

### Medium
- [x] Jump bracket C-M-f and C-M-b
- [x] show match bracket
- [x] C-x C-x, return to mark
  - okay this was very easy...
- [x] file path for buffers
  - prereq for backupfiles
- [x] backup files (i.e. foo.txt~)
- [x] negate (C--/M--)
  - Just works with zap-to-char for now
- [x] auto-indent

### Hard
- [x] Vertical split (C-x 3)
- [x] buffer controls (C-x b)
- [x] better isearch
  - [x] highlight all searching on the page
  - [x] put new page searches in middle of the screen
  - [x] case-insensitive searches unless a capital letter is present in query
  - [x] auto-jump to the first match (most Emacs' do this)
- [ ] proper undo/redo
  - [x] undo
  - [ ] redo (redo might be bound to C-x r or M-/ which would conflict with dabbrev-expand)
- [x] keyboard macros
  - save the keybindings and replay them
- [x] better clipboard support
  - just use M-e pbpaste or M-e xclip-whatever
- [x] unicode inputs
- [ ] Alert when a buffer-revert is needed (file has been updated outside the editor)

### Maybe Later
#### Likely
- [x] open file at line number
  - Go to the line specified by number (do not insert a space between the + sign and the number).
  - If a negative number is specified, the line number counts backwards from the end of the file.
  - I.e. +-1 will be the last line of the file, +-2 will be second last.
  - I.e. ait +20 file.txt
- [ ] tab completion for shell commands

#### Considering
- [ ] Auto-save files (i.e. #foo.txt#)
- [x] open multiple files from shell

#### Less Likely
- [ ] keybindings in msgline (isearch, find-file, etc.)
  - all keybindings use the curwp or curbp and msgline doesn't have those
  - might only support _some_ bindings.
- [ ] various colors for highlighting
  - this might be tricky to work with various terminal colors
- [ ] Beginning & end of paragraph (M-a, M-e)
  - It appears version 29 of GNU Emacs has replaced these functions with
    beginning/end of sentence.
- [ ] M-/, dabbrev-expand
  - big maybe on this one, but it is very useful.
- [ ] man page and --help option
- [x] highlight trailing whitespace
- [x] ~~syntax highlighting based on file extension~~

## Non-Standard Emacs
### Likely
- [x] quick jump to char in line
- [x] shell commands
  - [x] input STDOUT at point ~~or new buffer~~
  - [x] pipe region or file into shell command (sort, linter, etc)
  - [x] accept output of a program as an input (fzf, pick, etc.)

### Less Likely
- [ ] jump to word
- [ ] multiple cursors
- [ ] avy quick jump to line

## Housekeeping
- [x] Standardize tabs or spaces
- [ ] More generic functions
- [x] Speed up rendering
  - disabled keyword syntax highlight to speed this up
  - keyword syntax highlighting isn't really that important
- [ ] Compile on:
  - [ ] OpenBSD
  - [ ] FreeBSD
- [x] tty on BSDs
  - technically not fixed, but I added in a wsvt25 alias to termbox.

## Bugs
### High Priority
- [x] undoing is broken sometimes
- [x] canceled shell commands shouldn't do things
- [x] selecting a region and ending the cursor at `curbp->b_ebuf` and cutting will
cause an assertion error.
- [x] if you edit a file and save it a lot, eventually it'll start saving
binary data at the top of the file
- [x] if the region contains a $, it will mess up shell commands due to $'s use
in shell
- [x] M-t transposes symbols as well
- [x] cutting from the last line usually breaks the editor
- [x] shell commands can be buggy
- [x] screen flickers, especially on large files
  - it appears to happen when you get farther in the file

### Low Priority
- [x] sometimes isearch doesn't highlight the entire match when you're not current on it
- [x] sometimes isearch doesn't properly recenter
- [x] find-file crashes if you're in a deep path
- [x] sometimes the top row's first character is missing
- [x] matching <> '' and "" doesn't work right when you're on the ending one
  - I didn't fix the string '' or "" because figuring out direction is too annoying.
    The rule will be that you can only match '' and "" when on the front.
- [x] `C-x b` doesn't work well sometimes
- [x] opening files of the same name have no unique id
- [x] can only input and view standard emojis

## Termbox
- [x] Basic rendering
- [x] some functions don't work like isearch and find-file
- [x] use termbox stuff for keybindings
- [x] highlighting
- [x] atto syntax highlighting
  - atto supported some very basic highlighting
- [x] UTF8
- [x] use termbox keys for keybind definitions
